<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class ServiceCategory extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //  `parent_id` int(11) NOT NULL COMMENT '上一级ID',
        //  `name` varchar(255) NOT NULL COMMENT '分类名称',
        //  `icon` varchar(255) NOT NULL COMMENT '分类图标',
        Schema::dropIfExists('service_category');
        Schema::create('service_category', function (Blueprint $table){
            $table->comment = "服务分类表";
            $table->increments('id')->comment("ID");
            $table->integer("parent_id")->comment("上一级ID");
            $table->string("name")->comment("分类名称");
            $table->string("icon")->comment("分类图标");
            $table->tinyInteger('order')->default(0)->comment("排序");
            $table->integer('create_time')->comment("创建时间");
            $table->integer('update_time')->comment("更新时间");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
